﻿using System;

namespace T04ValueType
{
    class Program
    {
        //结构体
        struct Book
        {
            public int page;
            public double price;
        }
        //枚举
        enum FontType
        {
            Normal=10,
            Bold,
            Itaic
        }
        static void Main(string[] args)
        {
            Console.WriteLine("值类型演示");

            int a = 10;
            long b = 10L;
            short c = 10;
            Console.WriteLine(a.GetType());
            Console.WriteLine(b.GetType());
            Console.WriteLine(c.GetType());

            //实数
            float d = 1.0F;
            double e = 1.0;
            decimal f = 1.0M;
            Console.WriteLine(d.GetType());
            Console.WriteLine(e.GetType());
            Console.WriteLine(f.GetType());

            //字符
            //char g='a';
            char g='中';
            Console.WriteLine(g.GetType());

            //布尔
            Book book = new Book() { page = 20, price = 40.0 };
            Console.WriteLine("页码{0},价格{1}",book.page,book.price);

            //枚举
            FontType ft = FontType.Itaic;
            Console.WriteLine(ft);
            ft++;
            Console.WriteLine(ft);

            //等待输入
            Console.ReadKey();

                                              
        }
    }
}
